﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Configuration;
using System.Data.Linq;

public partial class _Default : System.Web.UI.Page
{
    string connectionString = WebConfigurationManager.ConnectionStrings["Movies"].ConnectionString;
    

    protected void Page_Load(object sender, EventArgs e)
    {
        DataContext con = new DataContext(connectionString);
        var tMovie = con.GetTable<Movie>();
        grid1.DataSource = from m in tMovie
                           where m.Director.Contains(txtDirector.Text)
                           select m;
        grid1.DataBind();
    }
}